﻿using System;
using System.IO;
using System.Windows.Controls;

namespace content.A06
{
    public partial class A0601:Page
    {
        public A0601()
        {
            InitializeComponent();
            Loaded += delegate
            {
                string path = @"A:\A0601";
                TextBlock1.Text = $"目录位置：{path}";
                try
                {
                    if (!Directory.Exists(path))
                    {
                        Directory.CreateDirectory(path);
                        TextBlock1.Text += "\n创建该目录成功。";
                    }
                    else
                    {
                        TextBlock1.Text += "\n该目录已存在。";
                    }
                }
                catch (Exception e)
                {
                    TextBlock1.Text += $"\n创建该目录失败: {e.Message}";
                }
            };
        }
    }
}